package com.nisure.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.nisure.annotation.DataSourceAnnotation;
import com.nisure.entities.Student;
import com.nisure.mappers.StudentMapper;
import com.nisure.service.StudentService;


@Service("studentService")
@Transactional
public class StudentServiceImpl implements StudentService {

	@Autowired
    private StudentMapper studentMapper;
	
	@Override
	 /**
     * 插入学生信息
     * @param student 学生信息
     * @param dbType 数据源Id
     * @return 插入成功后的学生id
     */
	 @DataSourceAnnotation
	public int insertStudent(Student student, String dsId) {
		 studentMapper.insertStudent(student);
	     return student.getId();
	}

}
